import java.io.*;
import java.lang.Math;

public class Test15 {
    public static void main(String[] args) throws IOException {
        long time = System.currentTimeMillis();

        String fileName = "D:\\Java\\randomNumbers.txt";

        BufferedWriter out = new BufferedWriter(new FileWriter(fileName));

        for (int i = 0; i < 100000; i++) {
            out.write((int)(Math.random() * 1000));
//            System.out.println((int)(Math.random() * 1000));
            out.newLine();
        }

        out.close();

        time = System.currentTimeMillis() - time;
        System.out.println("Time elapsed:" + time);

//        BufferedReader in = new BufferedReader(new FileReader(fileName));
//
//        String line = in.readLine();
//
//        while (line != null) {
//            System.out.println(line);
//            line = in.readLine();
//        }
//
//        in.close();
    }
}
